package com.cw.mapper;

import com.cw.entity.SysMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 菜单表 Mapper 接口
 * </p>
 *
 * @author smq
 * @since 2021-04-28
 */
public interface SysMenuMapper extends BaseMapper<SysMenu> {
    List<SysMenu> getSysMenu(@Param("menuId") String menuId, @Param("name") String name, @Param("code") String code, @Param("keepAlive") String keepAlive
            , @Param("nameLike") String nameLike);

    int insertSysMenu(SysMenu sysMenu);

    int updateSysMenu(SysMenu sysMenu);

    int deleteSysMenu(String menuId);

    /**
     *
     * 菜单设置是否可见
     * @param menuId
     * @param keepAlive
     * @return
     */
    int setKeepAlive(@Param("menuId") String menuId,@Param("keepAlive") String keepAlive);

    List<SysMenu> getSysMenuByUserId(@Param("userId") String userId);


    /**
     * 获取所有菜单
     * @param nameLike
     * @param keepAlive
     * @return
     */
    List<SysMenu> getSysMenus(@Param("menuId") Integer menuId,
                              @Param("nameLike") String nameLike, @Param("keepAlive") String keepAlive,@Param("code") String code,@Param("name") String name);

    /**
     * 获取菜单集合通过父级主键
     * @param parentId 父级主键
     * @author ly
     * @date 2020/9/23 15:01
     * @return java.util.List<com.kszs.entity.SysMenu>
     */
    List<SysMenu> getSysMenusByParentId(@Param("parentId") String parentId);
}
